from transformers import pipeline
from transformers import BertTokenizer,BertForSequenceClassification
import torch

tokenizer=BertTokenizer.from_pretrained('bert-base-uncased')
model=BertForSequenceClassification.from_pretrained('bert-base-uncased')

nlp=pipeline('sentiment-analysis',model=model,tokenizer=tokenizer)
text="I love programming in Python!"

result=nlp(text)
print(result)   